<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/WEB-INF/template/globalTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:t="http://myfaces.apache.org/tomahawk">

    <ui:define name="title">#{msg['application.titre.gestion.posteriori']}</ui:define>

    <ui:define name="ariane">
        <h:commandLink action="/faces/index.xhtml"  
                       value="#{msg['application.titre.accueil']}"/>
        >
        #{msg['application.titre.gestion.posteriori']}
    </ui:define>

    <ui:define name="content">
        <h:panelGroup styleClass="titre">Saisie a posteriori des sessions</h:panelGroup>
        <t:panelGrid columns="3" id="panelPosteriori">
            <h:outputLabel for="inputDomaine" value="Domaine"/>
            <p:selectOneMenu converter="#{genericConverter}" id="inputDomaine" 
                             value="#{postSessionBean.domaine}"
                              >
                <f:selectItem itemDisabled="true" itemLabel="Choisir un domaine ..." />
                <f:selectItems value="#{postSessionBean.listDomaine}" var="domaine" 
                               itemLabel="#{domaine.libelle}"/>
                <p:ajax update="inputFormation, selectFormation"/>
            </p:selectOneMenu>
            <p:message for="inputDomaine"/>

            <h:outputLabel for="inputFormation" value="Formation"/>
            <p:selectOneMenu value="#{postSessionBean.formation}"
                              
                             converter="#{genericConverter}" id="inputFormation">
                <f:selectItem itemDisabled="true" itemLabel="Choisir une Formation ..." />
                <f:selectItems value="#{postSessionBean.domaine.listFormation}" var="formation" 
                               itemLabel="#{formation.libelle}" id="selectFormation"/>
            </p:selectOneMenu>
            <p:message for="inputFormation"/>

            <h:outputLabel for="inputDate" value="Date"/>
            <p:calendar id="inputDate" pattern="dd/MM/yyyy" 
                        value="#{postSessionBean.dateFormation}"
                         />
            <p:message for="inputDate"/>

            <t:panelGroup colspan="3">
                Liste des formateurs ayant participés :
                <p:pickList value="#{postSessionBean.pickListFormateur}"
                            var="instructeur"
                            itemLabel="#{instructeur}"  
                            itemValue="#{instructeur}"
                            addAllLabel="Remplir"
                            addLabel="Ajouter"
                            removeAllLabel="Vider"
                            removeLabel="Retirer"
                            converter="#{genericConverter}"/>
            </t:panelGroup>
            <p:commandButton value="Créer" action="#{postSessionBean.creer}" update="panelPosteriori messages"/>
        </t:panelGrid>
    </ui:define>

</ui:composition>
